export default function request(options) {
	const BASE_URL = 'https://ku.qingnian8.com/dataApi'
	let { data, method = 'GET', url = '' } = options
	return new Promise((resolve,reject) => {
		uni.request({
			url: BASE_URL + url,
			data,
			success: res => {
				if(res.statusCode === 200) {
					resolve(res.data)
				} else {
					uni.showModal({
						title: '提示',
						content: res.errMsg,
						showCancel: false
					})
				}
			},
			fail: error => {
				reject(error)
			}
		})
	})
}